<link href="/assets/css/center.css" rel="stylesheet"/>

<!-- 头部 -->
<div class="user">
    <div class="avatar wow fadeInUp">
        <img src="{$business.avatar_cdn}"/>
    </div>
    <div class="nickname wow fadeInUp" data-wow-delay="100ms">{$business.nickname ?: $business.mobile_text}</div>
</div>

<!-- 菜单 -->
<div class="menulist wow fadeInUp" data-wow-delay="300ms">
    <a href="{:url('/home/business/profile')}" class="item">
        <span>基本资料</span>
        <img src='/assets/images/row.png'/>
    </a>
    {if condition="$business.auth != 1"}
    <a href="{:url('/home/business/email')}" class="item">
        <span>邮箱认证</span>
        <img src='/assets/images/row.png'/>
    </a>
    {/if}
    <a href="{:url('/home/business/order')}" class="item">
        <span>我的订单</span>
        <img src='/assets/images/row.png'/>
    </a>
    <a href="{:url('/home/business/record')}" class="item">
        <span>我的消费</span>
        <img src='/assets/images/row.png'/>
    </a>
    <a href="{:url('/home/pay/pay')}" class="item">
        <span>充值</span>
        <img src='/assets/images/row.png'/>
    </a>
    <a href="contact.html" class="item">
        <span>联系我们</span>
        <img src='/assets/images/row.png'/>
    </a>
    <a id="logout" href="javascript:void(0)" class="item">
        <span>退出</span>
        <img src='/assets/images/row.png'/>
    </a>
</div>

<!-- 引入底部 -->
{include file='common/footer'/}

<script>
    $('#logout').click(() => {
        mui.confirm(
            '是否确认退出当前账号？',
            '退出',
            ['确认', '取消'],
            function (res) {
                if (res.index === 0) {
                    $.ajax({
                        url: `{:url('/home/index/logout')}`,
                        type: 'post',
                        dataType: 'json',
                        success: function (res) {
                            if (res.code === 1) {
                                mui.toast(res.msg);

                                setTimeout(() => {
                                    location.href = res.url;
                                }, 2000);
                            }
                        }
                    });
                }
            }
        )
    })
</script>